package main

import (
	"fmt"
	"log"
	"os/exec"
	"syscall"
)

func main() {
	redisPath := `D:\Software\Redis\Redis-8.2.2\redis-server.exe`

	cmd := exec.Command("cmd", "/c", "start", "Redis Server", redisPath)

	// 隐藏执行 start 命令的 cmd 窗口
	cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}

	err := cmd.Start()
	if err != nil {
		log.Fatalf("启动Redis失败: %v", err)
	}

	fmt.Println("Redis服务器已在新窗口中启动！")
}
